QT -= gui
QT += network
QT += core

TARGET = network_service
TEMPLATE = lib
DEFINES += QTNETWORK_LIBRARY

CONFIG += c++11

# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

include(include/xpack/xpack.pri)

include(../qt_3rdparty_structure/appPack/Common.pri)

include(network_service.pri)

INCLUDEPATH += \
    $$PWD/include \


SOURCES += \
    CControlManage.cpp \
    CControlTool.cpp \
    CEntranceHttpClient.cpp \
    CEntranceHttpServer.cpp \
    CEntranceMqttClient.cpp \
    cmdHandle/CNetBase.cpp \
    cmdHandle/CNetConfig.cpp \
    cmdHandle/CWebUserInfo.cpp \
    qudpserver.cpp

HEADERS += \
    include/CConfig.h \
    include/CControlManage.h \
    include/CControlTool.h \
    include/CEntranceHttpClient.h \
    include/CEntranceHttpServer.h \
    include/CEntranceMqttClient.h \
    include/CNetSdk.h \
    include/CNetworkServiceHeader.h \
    include/CXJson.h \
    include/CcmdBase.h \
    include/cmdHandle/CNetBase.h \
    include/cmdHandle/CNetConfig.h \
    include/cmdHandle/CWebUserInfo.h \
    include/qudpserver.h \
    include/qtNetwork_global.h \
    include/ControlManage/cmdHandle.ih \
    include/ControlManage/cmdHandleBase.ih



target.path = $$DLLDESTDIR
INSTALLS += target

LIBS += -lbase_net -lbase_lib -lmbedcrypto -lmbedtls -lmbedx509


#拷贝公共头文件到发布目录
win32 {
    COPY_SRC = $$replace(PWD, /, \\)
    COPY_DEST = $$replace(PUBLIC_LIB_DIR, /, \\)
    system("xcopy /E /I /y $$COPY_SRC\\include\\* $$COPY_DEST\\include\\network_service\\")
}
else {
    system("mkdir $$PUBLIC_LIB_DIR/include/network_service/")
    system("cp -rf $$PWD/include/* $$PUBLIC_LIB_DIR/include/network_service/")
}
